<template>
  <div>
    <h3>计算属性</h3>
    <p>
      <input v-model="myText" type="text">
    </p>
    <ul>
      <li v-for="i in filter" :key="i">
        {{ i }}
      </li>
    </ul>
  </div>
</template>

<script>

export default {
  name: 'Form',
  data() {
    return {
      myText: '',
      list: ['aa', 'bb', 'ab', 'c', 'cb', 'd', 'cd']
    }
  },
  computed: {
    filter: function(params) {
      return this.list.filter((i) => i.indexOf(this.myText) !== -1)
    }
  },
  methods: {

  }
}
</script>

